-
Notifications
You must be signed in to change notification settings - Fork 948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Descriptor Array Extension #711
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is some impressive work!
I was worried that you mixed the binding model struct refactor into this extension PR, but the code appears to be much nicer now, and I'll be happy to have this extension supported.
Below is a few concerns and questions. Sorry about the annoying "don't match on a reference" notes! :)
wgpu-core/src/binding_model.rs
Outdated
@@ -135,32 +64,30 @@ pub struct BufferBinding { | |||
pub size: wgt::BufferSize, | |||
} | |||
|
|||
#[repr(C)] | |||
/// Duplicated in wgpu-rs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great that the doc comment is used, but it doesn't really explain what the structure is :)
Maybe lets turn it into a regular comment, or a //Note:
?
wgpu-core/src/binding_model.rs
Outdated
pub layout: BindGroupLayoutId, | ||
pub entries: *const BindGroupEntry, | ||
pub entries_length: usize, | ||
pub bindings: Vec<BindGroupEntry>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be using a slice &'a []
?
4425bf2
to
2a27434
Compare
Everything should be fixed now. Still waiting on the publishing of the backends so I can fix up cargo deps and make CI pass, but other than that, we're all set. wgpu-rs pr coming very shortly |
2a27434
to
98a5a40
Compare
98a5a40
to
3105394
Compare
3105394
to
501548a
Compare
Alright, we should be all ready. |
501548a
to
44eb7ca
Compare
44eb7ca
to
57b3b72
Compare
Yay! |
360: Implement TEXTURE_BINDING_ARRAY extension r=kvark a=cwfitzgerald This extends gfx-rs/wgpu#711 into wgpu-rs. Notable changes: - Added an example showing off both this extension and the future descriptor indexing extension. - Changed the framework so there is a static function showing what extensions you need. This is provided by the trait,, which defaults to no extensions, so existing examples and new ones don't have to care about extensions. Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
360: Implement TEXTURE_BINDING_ARRAY extension r=kvark a=cwfitzgerald This extends gfx-rs#711 into wgpu-rs. Notable changes: - Added an example showing off both this extension and the future descriptor indexing extension. - Changed the framework so there is a static function showing what extensions you need. This is provided by the trait,, which defaults to no extensions, so existing examples and new ones don't have to care about extensions. Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Connections
Blocked on gfx-rs/gfx#3269 and does some funky git overrides to get CI to return meaningful results what will be removed once that PR lands and is published.
Description
This PR implements the
TEXTURE_BINDING_ARRAY
native extension. This allows users to specify a uniform sized array of textures for use in shaders.As a corollary, this PR rustifies the Bind Group and Bind Group Layout interface. Two main actions were taken when doing this:
From what I can tell, this resulted in a significant reduction in code complexity when dealing with bind groups, favoring strong types over runtime assertions.
Naga validation of arrays of textures was not implemented.
Documentation was added to extensions to help users understand what underlying tech was being relied on as well as the platforms it should be expected to work on. I think this pattern should be implemented across the board for extensions as it makes them much more user friendly to use.
Testing
There is an example included in the wgpu-rs PR which was used for testing this feature. It worked on DX12, Vulkan, and Metal (MSL > 2.0), as was expected.
Additionally the other examples were run and are still verified to run.